﻿using System.Windows.Interop;
using Wix.Win8SetupBootstrapper.ViewModels;
using MahApps.Metro.Controls.Dialogs;

namespace Wix.Win8SetupBootstrapper.Views
{
    /// <summary>
    /// Interaction logic for WelcomePageView.xaml
    /// </summary>
    public partial class RootView
    {
        public RootView()
        {
            InitializeComponent();

            this.DataContext = new RootViewModel(this, null);
        }

        public RootView(WixBootstrapper wixBootstrapper)
        {
            InitializeComponent();
            var viewModel = new RootViewModel(this, wixBootstrapper) { Hwnd = new WindowInteropHelper(this).Handle };
            this.DataContext = viewModel;
        }

        public RootViewModel ViewModel
        {
            get { return (RootViewModel) DataContext; }
        }
    }
}
